layui.use(['upload','element','table','form','laytpl'],function(){
			 var $ = layui.jquery
  		,upload = layui.upload
			,table = layui.table
			,layer = layui.layer
			,element =layui.element
			,form = layui.form
			,laytpl = layui.laytpl
			var studentInfo = document.getElementById("studentInfo").innerHTML;
			var userKey = JSON.parse(sessionStorage.getItem("userKey"));
			//	  	console.log(userKey)
			if(userKey) {
				//如果存在,则说明登录过,先比对过期时间
				var delayTime = userKey.delayTime
				var nowTime = new Date().getTime()
				if(nowTime < delayTime) {
					//登录未失效
					laytpl(studentInfo).render(userKey, function(html) {
						$("#studentInfoView").html(html)
						element.render()
					})
				}
			}
		

		
		form.val('person', {
				"name":userKey.name,
				"studentNo":userKey.studentNo
			})
			
		
		//监听提交
		form.on('submit(submitPerson)', function(data) {
			$.ajax({
				type:"post",
				url:"http://localhost:8888/student/modify",
				data:data.field,
				success:function(data){
					layer.open({
						content: '修改成功,请重新登录',
						yes: function(index, layero) {
							sessionStorage.clear();
  							location.href ='../../index.html'
					
							//do something
							 layer.close(index); //如果设定了yes回调，需进行手工关闭
						}
					});
				},
				error:function(){
					layer.msg('修改失败', {					
						anim: 6
					});
				}
			});
			
			
			return false;
		});
  });

